package com.jxk.springcloud.alibaba.controller;

import com.jxk.springcloud.alibaba.domain.CommonResult;
import com.jxk.springcloud.alibaba.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : StorageController  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-29 16:47  //时间
 */
@RestController
public class StorageController {

    @Autowired
    private StorageService storageService;


    //扣减库存
    @RequestMapping("/storage/decrease")
    public CommonResult decrease(Long productId, Integer count) {
        storageService.decrease(productId, count);
        return new CommonResult(200,"扣减库存成功！");
    }
}

